package com.niodata.dp.task.service;

import com.niodata.dp.task.PluginPackageStore;
import com.niodata.dp.task.entity.PluginCategoryCountSta;
import com.niodata.dp.task.entity.PluginDocument;
import com.niodata.dp.task.entity.PluginDocumentView;
import com.niodata.dp.task.entity.PluginPackage;
import com.niodata.dp.task.entity.PluginPackageView;
import java.io.IOException;
import java.util.List;

public interface PluginManager2 extends PluginPackageStore, PluginTaskUseAgeListener {

  public PluginCategoryCountSta getPluginCategoryCount(long userId);


  public PluginCategoryCountSta getPublicToHubPluginCategoryCount();

  public List<PluginPackageView> getPlugins(long userId,
      String sysCategory,
      String funcCategory,
      String nameContains,
      int offset,
      int maxCount);

  public List<PluginPackageView> getPluginsPlublicToHub(
      String sysCategory,
      String funcCategory,
      String nameContains,
      int offset,
      int maxCount);

  public PluginPackage getPluginByNameVersion(long userid, String name, String version);

  public PluginDocument getPluginDocument(long userid, String name, String version);

  public PluginDocumentView getPluginDocumentView(long userId, String name, String version);

  public PluginDocumentView getPluginDocumentView(long userId, String pkgId);

  public void updateDocument(PluginDocument document);

  public void savePlugin(PluginPackage jobPackage, String document);

  public PluginPackage getPlugin(String id);

  public PluginPackage getPlugin(String name, String version);

  public List<PluginPackage> getAllPlugins();


  public boolean isRemoteStoreDfs();

  /**
   * remove package.
   *
   * @param name package name
   * @param version package version
   */
  public void removePlugin(String name, String version) throws IOException;

  public List<PluginPackage> getPluginsByName(String name);

  public List<String> getPluginTypes();

  public List<String> getSysCategories();

  public List<String> getFuncCategories(String sysCategory);

  public void update(PluginPackage pluginPackage);

  public void updatePluginUseCount(String pkgId);

  public String genUsageMd(PluginPackage pluginPackage) throws Exception;


}
